package com.springboot.controller;

import com.springboot.dto.Doctor;
import com.springboot.model.DoctorInfoForm;
import com.springboot.service.PatientIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;

/**
 * 病人主页，展示医院信息和医生列表
 */
@Controller
public class PatientIndexController {
    @Autowired
    PatientIndexService patientIndexService;

    @CrossOrigin
    @RequestMapping(value = "/patientIndex",method = RequestMethod.GET)
    @ResponseBody
    public ArrayList<Doctor> patientIndex() {
        ArrayList<Doctor> doctors =  patientIndexService.showMainDoctors("教授");
        return doctors;
    }
}
